package com.crm.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the CLIENT_INFO database table.
 * 
 */
@Entity
@Table(name="CLIENT_INFO")
@NamedQuery(name="ClientInfo.findAll", query="SELECT c FROM ClientInfo c")
public class ClientInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(initialValue = 1, allocationSize = 1,name="CLIENT_INFO_CID_GENERATOR", sequenceName="SEQ4")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CLIENT_INFO_CID_GENERATOR")
	private Long cid;

	private String address;

	@Column(name="CLIENT_INFO_IS_DEL")
	private String clientInfoIsDel;

	private String cname;

	@Temporal(TemporalType.DATE)
	@Column(name="CREATE_DATE")
	@JSONField(format="yyyy-MM-dd")
	private Date createDate;

	private String credit;//信用等级 高 中 低

	private String fax;

	private BigDecimal important;//重要程度		0：非常重要	1：重要	2：一般	3：不太重要	4：不重要

	private String industry;

	@Column(name="\"LOCAL\"")
	private String local;

	private String pay;

	private String phone;

	private String proflie;

	private String relationship;//关系等级	密切		较好		一般		较差

	private String remarks;

	private String scale;//规模 	10人以内		10-50人		50-200人		200-500人	500人以上

	private String source;

	private String stage;//阶段 潜在 签约 失效

	@Column(name="\"TYPE\"")
	private String type;//类型	客户		供应商		合作伙伴		媒体		其他

	@Temporal(TemporalType.DATE)
	@Column(name="UPDATE_DATE")
	@JSONField(format="yyyy-MM-dd")
	private Date updateDate;

	private String url;

	@Column(name="USER_ID")
	private BigDecimal userId;//用户编号

	//bi-directional many-to-one association to ClientTransfer
	@OneToMany(mappedBy="clientInfo")
	@JSONField(serialize=false)
	private List<ClientTransfer> clientTransfers;

	//bi-directional many-to-one association to Contact
	@OneToMany(mappedBy="clientInfo")
	@JSONField(serialize=false)
	private List<Contact> contacts;//联系人

	public ClientInfo() {
	}

	public Long getCid() {
		return this.cid;
	}

	public void setCid(Long cid) {
		this.cid = cid;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getClientInfoIsDel() {
		return this.clientInfoIsDel;
	}

	public void setClientInfoIsDel(String clientInfoIsDel) {
		this.clientInfoIsDel = clientInfoIsDel;
	}

	public String getCname() {
		return this.cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getCredit() {
		return this.credit;
	}

	public void setCredit(String credit) {
		this.credit = credit;
	}

	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public BigDecimal getImportant() {
		return this.important;
	}

	public void setImportant(BigDecimal important) {
		this.important = important;
	}

	public String getIndustry() {
		return this.industry;
	}

	public void setIndustry(String industry) {
		this.industry = industry;
	}

	public String getLocal() {
		return this.local;
	}

	public void setLocal(String local) {
		this.local = local;
	}

	public String getPay() {
		return this.pay;
	}

	public void setPay(String pay) {
		this.pay = pay;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getProflie() {
		return this.proflie;
	}

	public void setProflie(String proflie) {
		this.proflie = proflie;
	}

	public String getRelationship() {
		return this.relationship;
	}

	public void setRelationship(String relationship) {
		this.relationship = relationship;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getScale() {
		return this.scale;
	}

	public void setScale(String scale) {
		this.scale = scale;
	}

	public String getSource() {
		return this.source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getStage() {
		return this.stage;
	}

	public void setStage(String stage) {
		this.stage = stage;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public BigDecimal getUserId() {
		return this.userId;
	}

	public void setUserId(BigDecimal userId) {
		this.userId = userId;
	}

	public List<ClientTransfer> getClientTransfers() {
		return this.clientTransfers;
	}

	public void setClientTransfers(List<ClientTransfer> clientTransfers) {
		this.clientTransfers = clientTransfers;
	}

	public ClientTransfer addClientTransfer(ClientTransfer clientTransfer) {
		getClientTransfers().add(clientTransfer);
		clientTransfer.setClientInfo(this);

		return clientTransfer;
	}

	public ClientTransfer removeClientTransfer(ClientTransfer clientTransfer) {
		getClientTransfers().remove(clientTransfer);
		clientTransfer.setClientInfo(null);

		return clientTransfer;
	}

	public List<Contact> getContacts() {
		return this.contacts;
	}

	public void setContacts(List<Contact> contacts) {
		this.contacts = contacts;
	}

	public Contact addContact(Contact contact) {
		getContacts().add(contact);
		contact.setClientInfo(this);

		return contact;
	}

	public Contact removeContact(Contact contact) {
		getContacts().remove(contact);
		contact.setClientInfo(null);

		return contact;
	}

}